﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Notice2 : System.Web.UI.Page
{
    //用于动态设置页面标题
    protected string PageTitle1="";
    protected void Page_Load(object sender, EventArgs e)
    {
        
        int News_id = Convert.ToInt32(Session["News_id"]);
        OfficeDataClassesDataContext dc = new OfficeDataClassesDataContext();
        var News = from news in dc.News
                   where news.News_id.Equals(News_id)
                   select new
                   {
                       标题 = news.Title,
                       内容 = news.Content
                   };

        
        foreach (var news in News)
        {
           New_title.Text = Convert.ToString(news.标题);
           New_content.Text = Convert.ToString(news.内容);
           PageTitle.Text = Convert.ToString(news.标题);//动态设置网页的标题
        }
        dc.Dispose();
        
    }
}
